/*#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int a[][1000] = { 0 };
	int n, m,i,j;
	scanf("%d%d", &n, &m);
	for (i = 1; i <= n; i++)
	{
		for (j = 1; j <= m; j++)
			scanf("%d", &a[i][j]);
	}
	for(i=1;i<=n;i++)
		for (j = 1; j <= m; j++)
		{
			if (a[i][j] == 0)
			{
				j--;
				break;
			}
		}
	for(i=1;i<=n;i++)
		for (j = 1; j <= m; j++)
		{
			if (a[i][j] == 1)
			{
				printf("(%d,%d)>", i, j);
			}
			else
			{
				j--;
				break;
			}
     	}
	return 0;
}*/